1. Field of the Invention
The present invention is directed generally to the placing of a timestamp in a frame to be transmitted and, more particularly, in a portion of the frame that has been processed at a selected protocol layer of a protocol stack and also processed subsequently at another layer of the protocol stack whereat an error detection code for such portion is computed prior to placing the timestamp in such portion.
2. Description of the Related Art
In the monitoring, testing and maintenance of packet switched networks, it is necessary to measure accurately one or more measures of network latency, for example, the time it takes for a packet to traverse the network from its source to its destination. To measure this traversal time, various apparatus and methods have been developed in the prior art that share a basic concept of placing a timestamp, also referred to herein as timestamp information, into one or more packets to be transmitted into the network by a transmitting device and extracting such timestamp information from the packet at a receiving device. Using this basic concept various latency measurements of the network and also of associated devices under test within the network can be obtained.
According to this basic concept, timestamp information is obtained from a local clock or counter at the transmitting device and written into the packet prior to its transmission into the network. When the packet is received at the receiving device, timestamp information within the packet can be read and such information compared to received time information obtained from a local clock or counter at the receiving device. The difference between the received time information and the timestamp information conceptually reflects a static measure of the network latency between these two devices or network endpoints at a particular point in time.
However, since many networks, and especially the Internet, are continually carrying at any particular point in time packets for an indeterminate level of communication traffic, network latency measurements accordingly require timestamp containing packets to be transmitted continuously over a period of time, with the current timestamp information written into each packet, so that network latency data can be developed that has the broadest coverage and meaning in real time network traffic environments. In addition to timestamp containing packets sent from one endpoint to another, the timestamp containing packets can be transmitted and received from and to multiple endpoints, and at any of these endpoints further any device can act as both a transmitting and receiving device for itself or for other devices at other endpoints, such that the acquired latency data may provide a more complete dynamic overview of the network. For example, multiple point-to-point traversal and round trip transit times, latency through a specific node or device under test within the network, and other such parameters, and time variant changes thereto, can be obtained. Various types of test instruments for these endpoint devices are known in the prior art.
One requirement to ensure accuracy of the network latency measurement is that the clock or counter at the transmitting device must be synchronized with the corresponding clock or counter at the receiving device such that the difference between the time information derived from each device provides valid data. It is possible to synchronize the clocks or counters of two endpoint connected devices by operating them in lockstep or by first obtaining a known offset between them. In a network wherein the endpoints for the latency measurement are geographically diverse or wherein multiple endpoints are subject to the latency measurements, real time clocks in the endpoint devices may be synchronized using an accessible time service or network time protocol, as disclosed in Schulman, U.S. Pat. No. 5,600,632.
Another requirement to ensure accuracy of the network latency measurement is that the timestamp be written into the packet as near as possible to the time the transmitting device transmits such packet into the network. However, the functional specifications for the packet in which timestamp information is to be inserted, including the format and content of various fields therein required for compatibility with the networking framework of the network for which latency measurements are being obtained, are generally not amenable to the direct insertion of timestamp information into the packet upon its imminent transmission into the network.
The format and fields of any packet are defined by various protocols that a network connected device must be cognizant of to be able to interpret packets developed by another network connected device cognizant of the same protocols. Typically, the protocols are implemented as protocol layers of a hierarchical protocol stack. One of the commonly known networking frameworks for implementing protocols is the International Standard Organization's Open System Interconnection (ISO/OSI) model in which seven protocol layers in the hierarchical protocol stack have been defined as follows: Application (Layer 7), Presentation (Layer 6), Session (Layer 5), Transport (Layer 4), Network (Layer 3), Data Link (Layer 2) and Physical (Layer 1). Each of these layers is well know and a full description of each need not be set forth herein.
Exemplarily, in the generation of a packet at a transmitting device, wherein the packet is to contain user information to be transmitted over a network to a receiving device, the transmitting device passes control in its protocol stack from one protocol layer to the next, with processing of the packet starting at the top layer at which the user information is developed and proceeding successively through each lower layer to the bottom layer. Processing at each successively lower layer encapsulates the packet as processed by the previous layer typically by appending information to the packet in several formatted header fields. At the penultimate or lowest protocol layer, depending on the particular model of the protocol stack being used, the resultant packet as received from the previous layer is framed, converted into a bit stream and the frame transmitted into the network using the interface defined at the lowest layer. Generally the frame includes a data field that includes the resultant packet, a header pre-pended to the data field and a frame check sequence appended to the data field. The receiving device retrieves the user information from the frame by starting processing at the bottom layer of its corresponding protocol stack, processing successively back up through each layer of its the protocol stack wherein the header information added at each corresponding layer at the transmitting device is stripped from the packet, and processing ultimately the top layer whereat the received user information may be utilized.
Processing of a packet, which is to include timestamp information, at a present one of these protocols layers generally requires that timestamp information be contained within a data portion of the packet with the header exemplarily containing information of, inter alia, a numerically computed error detection code, such as a checksum, computed for the packet, including its data portion and header, at the present protocol layer. Since the error detection code cannot be computed until after the data portion has been generated, as well as any other header information, there is an inherent latency within the transmitting device between obtaining the timestamp information and encapsulating the packet at the present protocol layer. Furthermore, the timestamp information may have been required to be inserted into a data portion of the packet when being processed at a higher protocol layer, prior to the error detection code for the packet being computed at the present protocol layer, thereby resulting in yet greater latency between insertion of timestamp information into the packet and computation of the error detection code. Moreover, after processing at the present protocol layer, the packet may be subjected to further processing and encapsulation at one or more of lower protocol layers adding yet more latency prior to transmission of the frame containing this packet.
Therefore, the inherent latency within the transmitting device is indeterminate since it cannot be accurately determined due to unknown processing times at each of the protocol layers subsequent to inserting timestamp information into the packet and processor interrupts occurring during such processing. Accordingly, without any precise correction for the latency between obtaining the timestamp information and the actual time of transmission being possible, the network latency measurement, wherein a test instrument generates and transmits frames using timestamp containing packets as above described, timestamp information retrieved at a receiving test instrument inherently includes this indeterminate term and therefore does not accurately determine the true latency of the network.
In order to minimize the indeterminate latency within the transmitting device, Perches, U.S. Pat. No. 6,252,891, discloses a system and method to insert timestamp information into a packet by a test instrument in the form of a packet generator prior to transmission of the packet in a protocol neutral manner. As disclosed therein, an initial packet may be generated in a conventional manner at a particular protocol layer wherein the initial packet includes a network protocol portion and a payload portion. The payload portion contains several predefined fields and predetermined data within all except four of these fields wherein these four fields are initially empty. The four empty fields, which may be collectively referred to as a signature field, are each of a predetermined or reserved byte count. The network protocol portion contains a checksum computed for the initial packet from the data contained in the payload portion and other header information in the network protocol portion.
The initial packet is then processed by a test instrument that adds both a signature sequence and a transmit signature timestamp of appropriate byte count to their respective, but heretofore empty, predefined fields within the signature field reserved in the payload portion. In each successive packet generated by the test instrument, the signature sequence number is incremented for each successive packet starting with the initial sequence number obtained from the initial packet and the transmit signature timestamp for each successive packet is obtained from a local clock in the packet generator. Otherwise, all other fields in the payload portion and network protocol portion, including the pre-computed checksum, remain unchanged in each successive packet.
In order for the pre-computed checksum as computed in the initial packet to remain unchanged and valid for each successive packet after inclusion of the signature sequence number and transmit signature timestamp that change in each successive packet, the test instrument also adds a bit-by-bit inverse of the signature sequence number and a bit-by-bit inverse of the transmit signature timestamp to their respective predefined fields in the signature field. Accordingly, since the checksum of the signature sequence number and the transmit signature timestamp taken together with their respective inverses is zero, the pre-computed checksum in each successive packet remains valid irrespective of the insertion of the additional bytes into the signature field.
As described in the Perches reference, both of the signature sequence number and transmit signature timestamp, and their respective inverses, are inserted as binary information into their respective fields within the signature field during frame layer processing so that inherent latency between insertion of the timestamp and transmission of the frame is minimized. As long as the tests being performed by the transmitting device allow the insertion of the binary formatted signature field, the signature sequence number and transmit signature timestamp provide a convenient and accurate way for inserting timestamp information in the outgoing frames that can be retrieved by the receiving device, and thus allow computation of the latencies imposed by the network. Accordingly, the apparatus and methods disclosed in the Perches reference work well for the testing of Layer 2 and Layer 3 devices, and may possibly be used in some Layer 4 testing.
However, when testing higher layer protocols, and devices that are sensitive to those protocols, the insertion of the binary formatted fields is not generally viable. For example, the message portion for a packet processed at a Layer 7 protocol, such as the HTTP protocol, consists entirely of ASCII strings. Insertion of a binary-formatted field within this Layer 7 message portion would corrupt the HTTP messages, resulting in a high probability that the HTTP message would be dropped by devices under test that are cognizant of the HTTP protocol and need to interpret the HTTP messages during Layer 7 processing upon receipt.
It is known to embed an ASCII string containing timestamp information within ASCII messages developed by a Layer 7 application wherein timestamp information is obtained during Layer 7 processing. For Layer 7 protocols, such as HTTP, FTP and SMTP, among others, there are four known techniques to embed ASCII timestamp information during Layer 7 processing. The first technique embeds the ASCII timestamp information within a data portion of the packet processed at the Layer 7 protocol. This data portion is conventionally handled and tolerated by devices cognizant of Layer 7 in the network. The second technique involves embedding timestamp information in ASCII text descriptions (human readable) of Layer 7 protocol responses. The third technique involves embedding timestamp information into the Layer 7 protocol request fields, such as sub-domain names in DNS. The fourth technique uses extra headers or modifies existing headers within the Layer 7 protocol in such a manner to include timestamp information as to not change the operation and behavior of devices cognizant of the Layer 7 protocol in the network.
However, one significant disadvantage and limitation of each of these four techniques of embedding the ASCII timestamp during Layer 7 processing is that timestamp information must be inserted by the Layer 7 application in the test instrument, or transmitting device, into the ASCII message portion of the packet prior to passing the message to the next lower layer in the protocol stack and ultimately to the Layer 2 process that frames the resultant packet and transmits such frame. As described generally above, there can be a significant, indeterminate and uncontrolled latency in the protocol stack of the transmitting device from the time the timestamp is inserted during Layer 7 processing and the time the frame actually exits the test instrument. This test instrument latency, for example on the order of 10 ms, can be significant in terms of the link speed or of total network traversal time, and can thus render the latency measurements that are being attempted as unreliable or even meaningless.
Another significant disadvantage and limitation of each of these four techniques of embedding the ASCII timestamp during Layer 7 processing is that timestamp information is obtained prior to calculation of the Layer 4 checksum for the Layer 4 header that encapsulates the packet. Also as generally described above, since timestamp information is inserted during Layer 7 processing prior to the Layer 4 checksum being calculated, there is yet a further indeterminate latency within the test instrument.
Accordingly, there exists a need to provide a method and apparatus that can place timestamp information into a portion of a frame during frame layer processing wherein timestamp information is embedded into such portion subsequently to processing of such portion at an upper protocol layer and further subsequently to the computation of an error detection code for the packet including such portion at a lower protocol layer. There exists a further need to provide such method and apparatus wherein as many such frames as possible are capable of being transmitted continuously over a period of time, with the current timestamp information placed into each frame, such that upper layer latency measurements provide the broadest coverage and meaning in real time network traffic environments. There exists yet a further need to provide such method and apparatus wherein the frame includes timestamp information in the Layer 7 message portion.